package com.eastfair.venuebooking.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 跟进计划，记录保存 DTO.
 *
 * @author dqq
 * @date 2022 /6/11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "FollowRecordSaveDTO", description = "跟进记录表")
public class FollowRecordPlanSaveDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface Save {
    }

    /**
     * 跟进类型，数据字典
     */
    @ApiModelProperty(value = "跟进类型，数据字典")
    @Size(max = 64, message = "跟进类型，数据字典长度不能超过64", groups = {Save.class})
    @NotBlank(message = "跟进类型不可为空", groups = {Save.class})
    private String followType;
    /**
     * 跟进内容
     */
    @ApiModelProperty(value = "跟进内容")
    @Size(max = 255, message = "跟进内容长度不能超过255", groups = {Save.class})
    @NotBlank(message = "跟进内容不可为空", groups = {Save.class})
    private String content;
    /**
     * 跟进用户id
     */
    @ApiModelProperty(value = "跟进用户id")
    @NotNull(message = "跟进用户不可为空", groups = {Save.class})
    private Long followUserId;
    /**
     * 跟进日期
     */
    @ApiModelProperty(value = "跟进日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate followDate;
    /**
     * 跟进时间
     */
    @ApiModelProperty(value = "跟进时间")
    @NotNull(message = "跟进时间不可为空", groups = {Save.class})
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime followDateTime;

    /**
     * 跟进记录的类型，枚举，1.跟进客户，2.跟进线索，3.跟进商机
     */
    @ApiModelProperty(value = "跟进记录的类型，枚举，1.跟进客户，2.跟进线索，3.跟进商机")
    @Size(max = 20, message = "跟进记录的类型，枚举，1.跟进客户，2.跟进线索，3.跟进商机长度不能超过20", groups = {Save.class})
    @NotBlank(message = "跟进记录类型不可为空", groups = {Save.class})
    private String followRecordType;
    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
    private Long customerId;
    /**
     * 客户名称
     */
    @ApiModelProperty(value = "客户名称")
    @Size(max = 64, message = "客户名称长度不能超过64")
    private String customerName;
    /**
     * 客户状态，数据字典
     */
    @ApiModelProperty(value = "客户状态，数据字典")
    @Size(max = 64, message = "客户状态，数据字典长度不能超过64")
    private String customerStatus;
    /**
     * 联系人id
     */
    @ApiModelProperty(value = "联系人id")
    private Long contactId;
    /**
     * 联系人名称
     */
    @ApiModelProperty(value = "联系人名称")
    @Size(max = 64, message = "联系人名称长度不能超过64")
    private String contactName;
    /**
     * 线索id
     */
    @ApiModelProperty(value = "线索id")
    private Long clueId;
    /**
     * 线索名称
     */
    @ApiModelProperty(value = "线索名称")
    @Size(max = 64, message = "线索名称长度不能超过64")
    private String clueName;
    /**
     * 线索状态
     */
    @ApiModelProperty(value = "线索状态")
    @Size(max = 64, message = "线索状态长度不能超过64")
    private String clueStatus;
    /**
     * 商机id
     */
    @ApiModelProperty(value = "商机id")
    private Long businessOpportunityId;
    /**
     * 商机名称
     */
    @ApiModelProperty(value = "商机名称")
    @Size(max = 64, message = "商机名称长度不能超过64")
    private String businessOpportunityName;
    /**
     * 商机阶段，数据字段
     */
    @ApiModelProperty(value = "商机阶段，数据字段")
    @Size(max = 64, message = "商机阶段，数据字段长度不能超过64")
    private String businessOpportunityStage;

    /**
     * 合同id
     */
    @ApiModelProperty(value = "合同id")
    private Long contractManageId;
    /**
     * 合同名称
     */
    @ApiModelProperty(value = "合同名称")
    @Size(max = 255, message = "合同名称长度不能超过255")
    private String contractManageName;

    /**
     * 跟进计划id
     */
    @ApiModelProperty(value = "跟进计划id")
    private Long followPlanId;

    /**
     * 是否计划跟进
     */
    @ApiModelProperty(value = "是否计划跟进")
    private Boolean isPlanFollow;

    /**
     * 计划跟进信息
     */
    @ApiModelProperty(value = "计划跟进信息")
    private FollowPlanDTO followPlanSaveDTO;
}
